//
//  ButtonTableViewCell.m
//  Rail
//
//  Created by hychen on 2018/3/4.
//  Copyright © 2018年 Hychen. All rights reserved.
//

#import "ButtonTableViewCell.h"

@interface ButtonTableViewCell ()
@property (weak, nonatomic) IBOutlet UIButton *eventButton;

@end
@implementation ButtonTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)clickEventButton:(UIButton *)sender {
    if (self.BlockClickEventButton) {
        self.BlockClickEventButton();
    }
}

- (void)setButtonTitle:(NSString *)buttonTitle {
    _buttonTitle = buttonTitle;
    [self.eventButton setTitle:buttonTitle forState:UIControlStateNormal];
}

- (void)setIsDelete:(BOOL)isDelete {
    _isDelete = isDelete;
    if (isDelete) {
        [self.eventButton setBackgroundImage:ImageNamed_bb(@"app_delete_btn_n") forState:UIControlStateNormal];
        [self.eventButton setBackgroundImage:ImageNamed_bb(@"app_delete_btn_p") forState:UIControlStateHighlighted];
    }
}
@end
